<template>
  <div>
    <page-main>
      <div>
        <img
          src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=4171276206,2958076716&fm=26&gp=0.jpg"
        />
      </div>
    </page-main>
  </div>
</template>

<script>
import { getNotice } from '@/api/requests/admin'

export default {
  data () {
    return {

    }
  },
  methods: {
    main_get_notice () {
      
      getNotice().then(res => {
        if (res.code == 200) {
          let data = JSON.parse(res.data.value)
          this.$alert(data.content, ` 公告: ${data.title}`, {
            dangerouslyUseHTMLString: true,
            customClass: 'notice_alert'
          });
          localStorage.setItem('notice', 1)
        }

      })

    },
  },
  created () {
    if (localStorage.getItem('notice') == undefined) {
      this.main_get_notice()
    }
  },
}
</script>

<style lang="scss" scoped>
.page-main {
    height: 100vh;
    div {
        text-align: center;
        margin-top: 115px;
    }
}
</style>

<style lang="scss">
.notice_alert {
    width: 70vw;
    min-height: 50vh;
}
</style>
